import os

WORK_DIR = os.path.abspath(os.path.dirname(__file__))
print('WORK_DIR:', WORK_DIR)

def get_abs_path(path):
    return os.path.abspath(os.path.join(WORK_DIR, path))


def get_all_children(parent):
    all_children = []
    for child in parent.children():
        all_children.append(child)
        if hasattr(child, 'children'):
            all_children.extend(get_all_children(child))
    return all_children
